<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <title>BUPT药品仓储管理平台</title>
        <!-- Tell the browser to be responsive to screen width -->
        <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
        <!-- Bootstrap 3.3.5 -->
        <link rel="stylesheet" href="/drm/Public/Static/bootstrap/css/bootstrap.min.css">
        <!-- Font Awesome -->
        <link rel="stylesheet" href="/drm/Public/Static/font-awesome/css/font-awesome.min.css">
        <!-- Ionicons -->
        <link rel="stylesheet" href="/drm/Public/Static/ionicons/css/ionicons.min.css">
        <!-- Theme style -->
        <link rel="stylesheet" href="/drm/Public/Static/dist/css/AdminLTE.min.css">
        <!-- AdminLTE Skins. Choose a skin from the css/skins
        folder instead of downloading all of them to reduce the load. -->
        <link rel="stylesheet" href="/drm/Public/Static/dist/css/skins/_all-skins.min.css">
        <!-- iCheck -->
        <link rel="stylesheet" href="/drm/Public/Static/plugins/iCheck/flat/blue.css">
        <!-- Morris chart -->
        <link rel="stylesheet" href="/drm/Public/Static/plugins/morris/morris.css">
        <!-- jvectormap -->
        <link rel="stylesheet" href="/drm/Public/Static/plugins/jvectormap/jquery-jvectormap-1.2.2.css">
        <!-- Date Picker -->
        <link rel="stylesheet" href="/drm/Public/Static/plugins/datepicker/datepicker3.css">
        <!-- Daterange picker -->
        <link rel="stylesheet" href="/drm/Public/Static/plugins/daterangepicker/daterangepicker-bs3.css">
        <!-- bootstrap wysihtml5 - text editor -->
        <link rel="stylesheet" href="/drm/Public/Static/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css">
        <!--站点图标-->
        <link href="/drm/Public/favicon.ico" rel="shortcut icon">

    </head>

    <body class="hold-transition skin-blue sidebar-mini">

        <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
            <div class="modal-dialog" role="document">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                        <h4 class="modal-title" id="myModalLabel">消息提示</h4>
                    </div>
                    <div class="modal-body">
                        确认删除?
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                        <button type="button" id='yes' class="btn btn-danger" data-dismiss="modal">确认</button>
                    </div>
                </div>
            </div>
        </div>

        <div class="wrapper">
            <header class="main-header">
                <!-- Logo -->
                <a href="/drm/" class="logo">
                    <!-- mini logo for sidebar mini 50x50 pixels -->
                    <span class="logo-mini"><b>BUPT</b></span>
                    <!-- logo for regular state and mobile devices -->
                    <span class="logo-lg">药品仓储管理平台</span>
                </a>
                <!-- Header Navbar: style can be found in header.less -->
                <nav class="navbar navbar-static-top" role="navigation">
                    <!-- Sidebar toggle button-->
                    <a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button">
                        <span class="sr-only">Toggle navigation</span>
                    </a>
                    <div class="navbar-custom-menu">
                        <ul class="nav navbar-nav">

                            <!-- User Account: style can be found in dropdown.less -->
                            <li class="dropdown user user-menu">
                                <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                                    <!--<img src="/drm/Public/Static/dist/img/user2-160x160.jpg" class="user-image" alt="User Image">-->
                                    <span class="hidden-xs"><?php echo ($person["name"]); ?></span>
                                </a>
                                <ul class="dropdown-menu">
                                    <!-- User image -->
                                    <li class="user-header">
                                        <p>
                                            <small style="color:#FFFFF2"><?php echo (date('Y-m-d g:i a',time())); ?></small>
                                            <h1 style="color:#FFFFF2"><?php echo ($person["name"]); ?>
                                                <?php if($_COOKIE['class']== admin): ?></br>
                                                    <small style="color:#FFFFF2">管理员账户</small><?php endif; ?>
                                            </h1>
                                        </p>
                                    </li>
                     
                                    <li class="user-footer">
                                        <div class="pull-left">
                                            <a href="/drm/index.php/Home/User/Index/userRecover.html" class="btn btn-default btn-flat">修改密码</a>
                                        </div>
                                        <!--<div class="pull-middle">-->
                                            <!--<a href="/drm/index.php/userLogout.html" class="btn btn-default btn-flat">管理员登录</a>-->
                                        <!--</div>-->
                                        <div class="pull-right">
                                            <a href="/drm/index.php/Home/User/Index/userLogout.html" class="btn btn-default btn-flat">退出登录</a>
                                        </div>
                                    </li>
                                </ul>
                            </li>
                            <!-- Control Sidebar Toggle Button -->
                            <li>
                                <!--<a href="#" data-toggle="control-sidebar"><i class="fa fa-gears"></i></a>-->
                            </li>
                        </ul>
                    </div>
                </nav>
            </header>
            <!-- Left side column. contains the logo and sidebar -->
            <aside class="main-sidebar">
                <!-- sidebar: style can be found in sidebar.less -->
                <section class="sidebar">
                    <!-- sidebar menu: : style can be found in sidebar.less -->
                    <ul class="sidebar-menu">
                        <!-- <li class="header">操作面板</li> <--></-->
                        <!--药品管理-->
                        <li class="treeview">
                            <a href="#"><i class="glyphicon glyphicon-heart-empty"></i><span>药品管理</span></a>
                            <ul class="treeview-menu">
                                <li class="active"><a href="/drm/index.php/Home/Drugs/Index/"><i class="glyphicon glyphicon-th-list"></i>药品列表</a></li>
                                <li><a href="/drm/index.php/Home/Drugs/Index/drugAdd.html"><i class="glyphicon glyphicon-plus"></i>添加药品</a></li>
                            </ul>
                        </li>
                        <!--药品管理结束-->
                        <!--仓库管理-->
                        <li class="treeview">
                            <a href="#"><i class="glyphicon glyphicon-lock"></i><span>仓库管理</span></a>
                            <ul class="treeview-menu">
                                <li><a href="/drm/index.php/Home/Respo/Index/"><i class="glyphicon glyphicon-th-list"></i>仓库列表</a></li>
                                <li><a href="/drm/index.php/Home/Respo/Index/depotAdd.html"><i class="glyphicon glyphicon-plus"></i>添加仓库</a></li>
                            </ul>
                        </li>
                        <!--推送管理-->
                        <li class="treeview">
                            <a href="#"><i class="glyphicon glyphicon-tasks"></i><span>新消息</span><small class="label pull-right bg-red"><?php echo (cookie('over_drugs')); ?></small></a>
                            <ul class="treeview-menu">
                                <li><a href="/drm/index.php/Home/Notification/Index/getNotice.html"><i class="glyphicon glyphicon-flag"></i>药品过期事项</a></li>
                                <li><a href="#"><i class="glyphicon glyphicon-bookmark"></i>others</a></li>
                            </ul>
                        </li>

                        <!--药品冲突规则-->
                        <!-- <li class="treeview">
                            <a href="#"><i class="glyphicon glyphicon-link"></i><span>药品冲突</span></a>
                            <ul class="treeview-menu">
                                <li><a href="#"><i class="glyphicon glyphicon-plus"></i>新建药品冲突规则</a></li>
                                <li><a href="#"><i class="glyphicon glyphicon-th-large"></i>药品冲突列表</a></li>
                            </ul>
                        </li> -->

                        <!--仓库管理结束-->
                        <!--用户管理-->
                        <?php if($_COOKIE['class']== admin): ?><li class="treeview">
                                <a href="#"><i class="glyphicon glyphicon-user"></i><span>用户管理</span></a>
                                <ul class="treeview-menu">
                                    <li><a href="/drm/index.php/Home/User/Index/index.html"><i class="glyphicon glyphicon-th-list"></i>查看全部用户</a></li>
                                    <li><a href="/drm/index.php/Home/User/Index/userAdd.html"><i class="glyphicon glyphicon-plus"></i>用户添加</a></li>
                                </ul>
                            </li><?php endif; ?>
                        <!--用户管理结束-->
                    </ul>
                    <!--左侧栏结束-->
                </section>
                <!-- /.sidebar -->
            </aside>
            <!-- Content Wrapper. Contains page content -->
            <div class="content-wrapper">
                <!-- Content Header (Page header) -->
                <section class="content-header">
                    <h1 class='lead'>BUPT
                        <small></small>
                    </h1>
                    <ol class="breadcrumb">
                        <li><a href="/drm/"><i class="fa fa-dashboard"></i>Home</a></li>
                        <!--<li class="active">Dashboard</li>-->
                    </ol>
                </section><!-- /.content -->

    <section class="content">
        <div class="row">
            <div class="col-xs-12">
                <div class="box">
                    <div class="box-header">
                        <h3 class="box-title">系统用户列表</h3>
                        <!--搜索工具栏
                           -<div class="box-tools">
                           -    <div class="input-group" style="width: 150px;">
                           -        <input type="text" name="table_search" class="form-control input-sm pull-right" placeholder="Search">
                           -        <div class="input-group-btn">
                           -            <button class="btn btn-sm btn-default"><i class="fa fa-search"></i></button>
                           -        </div>
                           -    </div>
                           -</div>
                           -->
                    </div><!-- /.box-header -->
                    <div class="box-body table-responsive no-padding">
                        <table class="table table-hover">
                            <tr>
                                <th>用户名</th>
                                <th>创建时间</th>
                                <th>操作</th>
                            </tr>
                            <?php if(is_array($data["data"])): foreach($data["data"] as $key=>$vo): ?><tr>
                                    <td><?php echo ($vo['username']); ?></td>
                                    <td><?php echo (date('Y-m-d H:i:s',$vo['ctime'])); ?></td>
                                    <td>
                                        <button type="button" data-id="<?php echo ($vo['id']); ?>" class="btn btn-danger delete" data-toggle="modal" data-target="#myModal">删除</button>　
                                        <!-- <a href="/drm/index.php/Home/User/Index/userEdit.html?id=<?php echo ($vo['id']); ?>"><button type="button" class="btn btn-warning">修改密码</button></a> -->
                                        <a href="/drm/index.php/Home/User/Index/userRecover.html"><button type="button" class="btn btn-warning">修改密码</button></a>
                                    </td>
                                </tr><?php endforeach; endif; ?>
                        </table>
                    </div><!-- /.box-body -->
                </div><!-- /.box -->
            </div>
        </div>
    </section>
                    <!-- jQuery 2.1.4 -->
                <script src="/drm/Public/Static/plugins/jQuery/jQuery-2.1.4.min.js"></script>
                <!-- jQuery UI 1.11.4 -->
                <script src="/drm/Public/Static/plugins/jQueryUI/jquery-ui.min.js"></script>
                <!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
                <script>
                    $.widget.bridge('uibutton', $.ui.button);
                </script>
                <!-- Bootstrap 3.3.5 -->
                <script src="/drm/Public/Static/bootstrap/js/bootstrap.min.js"></script>
                <!-- Morris.js charts -->
                <script src="/drm/Public/Static/plugins/raphael/raphael-min.js"></script>
                <script src="/drm/Public/Static/plugins/morris/morris.min.js"></script>
                <!-- Sparkline -->
                <script src="/drm/Public/Static/plugins/sparkline/jquery.sparkline.min.js"></script>
                <!-- jvectormap -->
                <script src="/drm/Public/Static/plugins/jvectormap/jquery-jvectormap-1.2.2.min.js"></script>
                <script src="/drm/Public/Static/plugins/jvectormap/jquery-jvectormap-world-mill-en.js"></script>
                <!-- jQuery Knob Chart -->
                <script src="/drm/Public/Static/plugins/knob/jquery.knob.js"></script>
                <!-- daterangepicker -->
                <script src="/drm/Public/Static/plugins/moment/moment.min.js"></script>
                <script src="/drm/Public/Static/plugins/daterangepicker/daterangepicker.js"></script>
                <!-- datepicker -->
                <script src="/drm/Public/Static/plugins/datepicker/bootstrap-datepicker.js"></script>
                <!-- Bootstrap WYSIHTML5 -->
                <script src="/drm/Public/Static/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js"></script>
                <!-- Slimscroll -->
                <script src="/drm/Public/Static/plugins/slimScroll/jquery.slimscroll.min.js"></script>
                <!-- FastClick -->
                <script src="/drm/Public/Static/plugins/fastclick/fastclick.min.js"></script>
                <!-- AdminLTE App -->
                <script src="/drm/Public/Static/dist/js/app.min.js"></script>
                <!-- AdminLTE dashboard demo (This is only for demo purposes) -->
                <script src="/drm/Public/Static/dist/js/pages/dashboard.js"></script>
                <!-- AdminLTE for demo purposes -->
                <script src="/drm/Public/Static/dist/js/demo.js"></script>
            </div>
        </div>
    </body>
</html>

        <script>

            $('.delete').click(function(){
                var id = $(this).data('id');

                $('#yes').click(function(){
                    $.post('/drm/index.php/Home/User/Index/userDelete.html',{'id':id},function(){
                        window.location.reload();
                    })
                })
            })
        </script>